/***********************************************************************************
File        : cemstata_v1.do 
Authors     : Ariel Dora Stern & Nick Menzies
Created     : 26 Apr 2010
Modified    : 27 Apr 2010
Description : Create matched datasets
***********************************************************************************/
clear 
set more off
set linesize 200
set mem 500m
cd "C:\Users\Nick\Documents\Harvard\Courses\Gov 2001\Replication Paper\Data files\Country files"


***Load CEM program

net from http://gking.harvard.edu/cem/
net install cem

net from http://gking.harvard.edu/clarify
net install clarify


*** Load data
clear
use 5countriespooledshort.dta

*** Create ethnicity dummies

tab ethny, gen(_Ieth_)

tab ethny if country == 0, gen(_IcouXeth_0_)
tab ethny if country == 1, gen(_IcouXeth_1_)
tab ethny if country == 2, gen(_IcouXeth_2_)
tab ethny if country == 3, gen(_IcouXeth_3_)

save "5countriespooledshort.dta", replace

** note there are no Tanzania ethinicity data
** 'Treatment' variables =  educateg


****************************************************************
************* CEM FOR POOLED DATA, EDUCATEG 0 -> 1 *************
****************************************************************


** Need to drop NAs from 'treatment variable so it is binary (below)

keep if educateg==0 | educateg==1

cem male country urban currentmarried formermarried widow morethanonemarriage ///
	polygamous protestant muslim othereligion earthfloorall agegroup , tr(educateg)


**************************************************************************************************
************* Run Pooled Analyses with CEM data, including matched control variables *************
**************************************************************************************************
* from here:

set more off

*****************************************
************** BURKINA ******************
*****************************************

****************** IV REGRESSION *********************

*** IV, BURKINA, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & burkina==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(BF Male) replace 

*** IV, BURKINA, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & burkina==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(BF Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, BURKINA, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & burkina==1, vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(BF Male) replace 


*** PROBIT, BURKINA, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & burkina==1 , vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(BF Male) append


*****************************************
************** CAMEROON *****************
*****************************************

****************** IV REGRESSION *********************

*** IV, CAMEROON, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & cameroon==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(CM Male) append 

*** IV, CAMEROON, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & cameroon==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(CM Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, CAMEROON, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & cameroon==1, vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(CM Male) append 


*** PROBIT, CAMEROON, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & cameroon==1 , vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(CM Female) append


*****************************************
************** GHANA ********************
*****************************************

****************** IV REGRESSION *********************

*** IV, GHANA, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & ghana==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(GH Male) append 

*** IV, GHANA, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & ghana==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(GH Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, GHANA, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & ghana==1, vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(GH Male) append 


*** PROBIT, GHANA, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & ghana==1 , vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(GH Female) append



*****************************************
************** KENYA ********************
*****************************************

****************** IV REGRESSION *********************

*** IV, KENYA, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & kenya==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(KE Male) append 

*** IV, KENYA, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & kenya==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(KE Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, KENYA, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & kenya==1, vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(KE Male) append 


*** PROBIT, KENYA, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & kenya==1 , vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(KE Female) append


*****************************************
************** TANZANIA *****************
*****************************************

****************** IV REGRESSION *********************

*** IV, TANZANIA , MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & tanzania==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(TZ Male) append 

*** IV, TANZANIA , FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & tanzania==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(TZ Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, TANZANIA , MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* ///
	[pweight=cem_weights] if male==1 & tanzania==1, vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(TZ Male) append 


*** PROBIT, TANZANIA , FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* ///
	[pweight=cem_weights] if male==0 & tanzania==1 , vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(TZ Female) append


*****************************************
************** ALL POOLED ***************
*****************************************

****************** IV REGRESSION *********************

*** IV, ALL POOLED , MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*   ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(ALL Male) append 

*** IV, ALL POOLED , FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*   ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0, vce(cluster cluster)

outreg educateg using CEM_iv1.out, se bracket nocons ctitle(ALL Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, ALL POOLED , MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1, vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(ALL Male) append 


*** PROBIT, ALL POOLED , FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0, vce(cluster cluster)

outreg educateg using CEM_probit1.out, se bracket ctitle(ALL Female) append


****************************************************************
************* CEM FOR POOLED DATA, EDUCATEG 1 -> 2 *************
****************************************************************


** Need to drop NAs from 'treatment variable so it is binary (below)
clear
use 5countriespooledshort.dta

keep if educateg==1 | educateg==2

cem male country urban currentmarried formermarried widow morethanonemarriage ///
	polygamous protestant muslim othereligion earthfloorall agegroup , tr(educateg)


**************************************************************************************************
************* Run Pooled Analyses with CEM data, including matched control variables *************
**************************************************************************************************
* from here:

set more off

*****************************************
************** BURKINA ******************
*****************************************

****************** IV REGRESSION *********************

*** IV, BURKINA, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & burkina==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(BF Male) replace 

*** IV, BURKINA, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & burkina==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(BF Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, BURKINA, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & burkina==1, vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(BF Male) replace 


*** PROBIT, BURKINA, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & burkina==1 , vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(BF Male) append


*****************************************
************** CAMEROON *****************
*****************************************

****************** IV REGRESSION *********************

*** IV, CAMEROON, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & cameroon==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(CM Male) append 

*** IV, CAMEROON, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & cameroon==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(CM Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, CAMEROON, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & cameroon==1, vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(CM Male) append 


*** PROBIT, CAMEROON, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & cameroon==1 , vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(CM Female) append


*****************************************
************** GHANA ********************
*****************************************

****************** IV REGRESSION *********************

*** IV, GHANA, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & ghana==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(GH Male) append 

*** IV, GHANA, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & ghana==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(GH Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, GHANA, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & ghana==1, vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(GH Male) append 


*** PROBIT, GHANA, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & ghana==1 , vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(GH Female) append



*****************************************
************** KENYA ********************
*****************************************

****************** IV REGRESSION *********************

*** IV, KENYA, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & kenya==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(KE Male) append 

*** IV, KENYA, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & kenya==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(KE Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, KENYA, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & kenya==1, vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(KE Male) append 


*** PROBIT, KENYA, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & kenya==1 , vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(KE Female) append


*****************************************
************** TANZANIA *****************
*****************************************

****************** IV REGRESSION *********************

*** IV, TANZANIA , MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & tanzania==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(TZ Male) append 

*** IV, TANZANIA , FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & tanzania==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(TZ Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, TANZANIA , MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* ///
	[pweight=cem_weights] if male==1 & tanzania==1, vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(TZ Male) append 


*** PROBIT, TANZANIA , FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* ///
	[pweight=cem_weights] if male==0 & tanzania==1 , vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(TZ Female) append


*****************************************
************** ALL POOLED ***************
*****************************************

****************** IV REGRESSION *********************

*** IV, ALL POOLED , MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*   ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(ALL Male) append 

*** IV, ALL POOLED , FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*   ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0, vce(cluster cluster)

outreg educateg using CEM_iv2.out, se bracket nocons ctitle(ALL Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, ALL POOLED , MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1, vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(ALL Male) append 


*** PROBIT, ALL POOLED , FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0, vce(cluster cluster)

outreg educateg using CEM_probit2.out, se bracket ctitle(ALL Female) append


****************************************************************
************* CEM FOR POOLED DATA, EDUCATEG 2 -> 3 *************
****************************************************************


** Need to drop NAs from 'treatment variable so it is binary (below)
clear
use 5countriespooledshort.dta

keep if educateg==2 | educateg==3

cem male country urban currentmarried formermarried widow morethanonemarriage ///
	polygamous protestant muslim othereligion earthfloorall agegroup , tr(educateg)


**************************************************************************************************
************* Run Pooled Analyses with CEM data, including matched control variables *************
**************************************************************************************************
* from here:

set more off

*****************************************
************** BURKINA ******************
*****************************************

****************** IV REGRESSION *********************

*** IV, BURKINA, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & burkina==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(BF Male) replace 

*** IV, BURKINA, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & burkina==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(BF Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, BURKINA, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & burkina==1, vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(BF Male) replace 


*** PROBIT, BURKINA, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & burkina==1 , vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(BF Male) append


*****************************************
************** CAMEROON *****************
*****************************************

****************** IV REGRESSION *********************

*** IV, CAMEROON, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & cameroon==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(CM Male) append 

*** IV, CAMEROON, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & cameroon==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(CM Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, CAMEROON, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & cameroon==1, vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(CM Male) append 


*** PROBIT, CAMEROON, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & cameroon==1 , vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(CM Female) append


*****************************************
************** GHANA ********************
*****************************************

****************** IV REGRESSION *********************

*** IV, GHANA, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & ghana==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(GH Male) append 

*** IV, GHANA, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & ghana==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(GH Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, GHANA, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & ghana==1, vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(GH Male) append 


*** PROBIT, GHANA, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & ghana==1 , vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(GH Female) append



*****************************************
************** KENYA ********************
*****************************************

****************** IV REGRESSION *********************

*** IV, KENYA, MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & kenya==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(KE Male) append 

*** IV, KENYA, FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*  ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & kenya==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(KE Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, KENYA, MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1 & kenya==1, vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(KE Male) append 


*** PROBIT, KENYA, FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	widow morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0 & kenya==1 , vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(KE Female) append


*****************************************
************** TANZANIA *****************
*****************************************

****************** IV REGRESSION *********************

*** IV, TANZANIA , MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1 & tanzania==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(TZ Male) append 

*** IV, TANZANIA , FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0 & tanzania==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(TZ Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, TANZANIA , MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* ///
	[pweight=cem_weights] if male==1 & tanzania==1, vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(TZ Male) append 


*** PROBIT, TANZANIA , FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* ///
	[pweight=cem_weights] if male==0 & tanzania==1 , vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(TZ Female) append


*****************************************
************** ALL POOLED ***************
*****************************************

****************** IV REGRESSION *********************

*** IV, ALL POOLED , MALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*   ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==1, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(ALL Male) append 

*** IV, ALL POOLED , FEMALE ***
ivregress 2sls hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	agegr* _Ireg* _Ieth*   ///
	(earthfloorall=pitlatrineall electricityall radioall televisionall ///
	refrigeratorall bicycleall motorcycleall cartruckall) ///
	 [pweight=cem_weights] if male==0, vce(cluster cluster)

outreg educateg using CEM_iv3.out, se bracket nocons ctitle(ALL Female) append 


****************** PROBIT REGRESSION *********************

*** PROBIT, ALL POOLED , MALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==1, vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(ALL Male) append 


*** PROBIT, ALL POOLED , FEMALE ***
dprobit hivpositive educateg urban currentmarried formermarried ///
	morethanonemarriage polygamous protestant muslim othereligion ///
	earthfloorall agegr* _Ireg* _Ieth* ///
	[pweight=cem_weights] if male==0, vce(cluster cluster)

outreg educateg using CEM_probit3.out, se bracket ctitle(ALL Female) append
